package com.net.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.net.dao.ProviderDao;
import com.net.model.Provider;
import com.net.service.ProviderService;
@Component("providerService")
public class ProviderServiceImpl implements ProviderService {
	private ProviderDao providerDao ;

	public void add(Provider u) throws Exception {
		providerDao.save(u);
	}

	public boolean delete(Provider u) {
		return providerDao.delete(u);
	}

	public List<Provider> getProviders() throws Exception {
		return providerDao.getProviders();
	}

	public Provider loadProviderByName(String name) throws Exception {
		return providerDao.loadProviderByName(name);
	}

	public Provider loadProviderById(int id) {
		return providerDao.loadProviderById(id);
	}

	public ProviderDao getProviderDao() {
		return providerDao;
	}
	@Resource(name="providerDao")
	public void setProviderDao(ProviderDao providerDao) {
		this.providerDao = providerDao;
	}

	public void update(Provider provider) {
		this.providerDao.update(provider);
	}

	public List<Provider> searchList(String param1, String param2, String param3) {
		return providerDao.searchList(param1, param2, param3);
	}

	public int getCount() {
		return providerDao.getCount();
	}

	public List<Provider> getProviders(int currentPage, int perPage,
			String orderType, String orderName) {
		return providerDao.getProviders(currentPage, perPage, orderType, orderName);
	}

	public List<Provider> getProvidersByCondition(int currentPage, int perPage,
			String condition) {
		return providerDao.getProviderByCondition(currentPage, perPage, condition);
	}

}
